package com.jdk.demo.bufferedReader;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class CopyFileDemo {

	public static void main(String[] args) throws IOException {
		// 封装数据源
		BufferedReader fr = new BufferedReader(new FileReader("E:/zsl/temp2.txt"));
		// 封装目的地
		BufferedWriter fw = new BufferedWriter(new FileWriter("E:/zsl/temp3.txt"));

		String line = null;
		while ((line = fr.readLine()) != null) {
			fw.write(line);
			fw.newLine();
		}
		fw.flush();

		// 释放资源
		fw.close();
		fr.close();
	}

}
